package org.sdp.pearproject.dto.convert;

import org.sdp.pearproject.dao.domain.*;
import org.sdp.pearproject.dto.request.*;
import java.util.Date;

/**
 * @ClassName: DepartmentAddRequestConvert
 * @Description:
 * @Author: SDP
 * @Date: 2022-07-15
 * @Version: 1.0
 * Table: pear_department
 * Comment:
 * 部门表
 */
public class DepartmentAddRequestConvert extends BaseConvert {
    public static DepartmentWithBLOBs convert(DepartmentAddRequest request) throws Exception {
        DepartmentWithBLOBs daoRequest = new DepartmentWithBLOBs();
        copyProperties(request, daoRequest);

        daoRequest.setCode(daoRequest.getCode() == null ? null : daoRequest.getCode().trim());
        daoRequest.setOrganizationCode(daoRequest.getOrganizationCode() == null ? null : daoRequest.getOrganizationCode().trim());
        daoRequest.setName(daoRequest.getName() == null ? null : daoRequest.getName().trim());
        daoRequest.setPcode(daoRequest.getPcode() == null ? null : daoRequest.getPcode().trim());
        daoRequest.setIcon(daoRequest.getIcon() == null ? null : daoRequest.getIcon().trim());
        daoRequest.setPath(daoRequest.getPath() == null ? null : daoRequest.getPath().trim());

        return daoRequest;
    }
}
